define("pages/jls_xsqkdj/xsqkdjmain", [
    ],
    function(require) {



        var initHtml = function(){
            var user_permission = 2 ; 	//设置获取到的用户权限
            var rsdj_permission = 2 ;	//设置出所管理需要的权限
            var container = document.getElementById("main");
            var graph = new mxGraph(container);
            var parent = graph.getDefaultParent();

            graph.setHtmlLabels(true);

            graph.setEnabled(false);

            var style = {};

            style = graph.getStylesheet().getDefaultEdgeStyle();//圆角连线
            style[mxConstants.STYLE_ROUNDED] = true;//圆角连线
            style = mxUtils.clone(style);
            style[mxConstants.STYLE_SHAPE] = mxConstants.SHAPE_LABEL;  // 不设置这个属性 背景图片不出来

            style[mxConstants.STYLE_STROKECOLOR] = '#f5f5f5';

            style[mxConstants.STYLE_FILLCOLOR] = '#f5f5f5';

            style[mxConstants.STYLE_FONTCOLOR] = 'black';

            style[mxConstants.STYLE_ALIGN] = mxConstants.ALIGN_CENTER;

            style[mxConstants.STYLE_VERTICAL_ALIGN] = mxConstants.ALIGN_BOTTOM;

            style[mxConstants.STYLE_FONTSIZE] = 13;

            style[mxConstants.STYLE_IMAGE_ALIGN] = 0;

            style[mxConstants.STYLE_IMAGE_VERTICAL_ALIGN] = 0;

            style[mxConstants.STYLE_IMAGE] = '../../img/lcttx.png';

            style[mxConstants.STYLE_IMAGE_WIDTH] = 80;

            style[mxConstants.STYLE_IMAGE_HEIGHT] = 80;

            style[mxConstants.STYLE_SPACING_TOP] = 30;

            style[mxConstants.STYLE_SPACING] = 0.5;

            graph.getStylesheet().putCellStyle("style1", style);

            var style2 = {};

            style2 = graph.getStylesheet().getDefaultEdgeStyle();//圆角连线
            style2[mxConstants.STYLE_ROUNDED] = true;//圆角连线
            style2 = mxUtils.clone(style);
            style2[mxConstants.STYLE_SHAPE] = mxConstants.SHAPE_LABEL;  // 不设置这个属性 背景图片不出来

            style2[mxConstants.STYLE_STROKECOLOR] = '#f5f5f5';

            style2[mxConstants.STYLE_FILLCOLOR] = '#f5f5f5';

            style2[mxConstants.STYLE_FONTCOLOR] = 'black';

            style2[mxConstants.STYLE_ALIGN] = mxConstants.ALIGN_CENTER;

            style2[mxConstants.STYLE_VERTICAL_ALIGN] = mxConstants.ALIGN_BOTTOM;

            style2[mxConstants.STYLE_FONTSIZE] = 13;

            style2[mxConstants.STYLE_IMAGE_ALIGN] = 0;

            style2[mxConstants.STYLE_IMAGE_VERTICAL_ALIGN] = 0;

            style2[mxConstants.STYLE_IMAGE] = '../../img/zh.png';

            style2[mxConstants.STYLE_IMAGE_WIDTH] = 80;

            style2[mxConstants.STYLE_IMAGE_HEIGHT] = 80;

            style2[mxConstants.STYLE_SPACING_TOP] = 30;

            style2[mxConstants.STYLE_SPACING] = 0.5;

            graph.getStylesheet().putCellStyle("style2", style2);

            var style3 = {};

            style3 = graph.getStylesheet().getDefaultEdgeStyle();//圆角连线
            style3[mxConstants.STYLE_ROUNDED] = true;//圆角连线
            style3 = mxUtils.clone(style);
            style3[mxConstants.STYLE_SHAPE] = mxConstants.SHAPE_LABEL;  // 不设置这个属性 背景图片不出来

            style3[mxConstants.STYLE_STROKECOLOR] = '#f5f5f5';

            style3[mxConstants.STYLE_FILLCOLOR] = '#f5f5f5';

            style3[mxConstants.STYLE_FONTCOLOR] = 'black';

            style3[mxConstants.STYLE_ALIGN] = mxConstants.ALIGN_CENTER;

            style3[mxConstants.STYLE_VERTICAL_ALIGN] = mxConstants.ALIGN_BOTTOM;

            style3[mxConstants.STYLE_FONTSIZE] = 13;

            style3[mxConstants.STYLE_IMAGE_ALIGN] = 0;

            style3[mxConstants.STYLE_IMAGE_VERTICAL_ALIGN] = 0;

            style3[mxConstants.STYLE_IMAGE] = '../../img/lcttx.png';

            style3[mxConstants.STYLE_IMAGE_WIDTH] = 80;

            style3[mxConstants.STYLE_IMAGE_HEIGHT] = 80;

            style3[mxConstants.STYLE_SPACING_TOP] = 30;

            style3[mxConstants.STYLE_SPACING] = 0.5;

            graph.getStylesheet().putCellStyle("style3", style3);


            //获取流程节点的待办数量
            var xsqkdjCount=0;
            var xsclCount=0;
            var xscxCount=0;


            // 画人物
            var v1 = graph.insertVertex(parent, 'xsqkdj', '巡视情况登记<font color="red"></font>', 360, 220, 100, 105, "style1");
            var v2 = graph.insertVertex(parent, 'xscl', '巡视处理<font color="red"></font>', 560, 220, 100, 105, "style2");
            var v3 = graph.insertVertex(parent, 'xscx', '巡视查询<font color="red"></font>', 760, 220, 100, 105,"style3");

            // 连线
            /* graph.insertEdge(parent, null, '',v1, v2 , "edgeStyle=elbowEdgeStyle;");
               graph.insertEdge(parent, null, '',v2, v3 , "edgeStyle=elbowEdgeStyle;");*/







            //添加事件
            graph.addListener(mxEvent.CLICK, function(sender, evt) {
                var cell11 = evt.getProperty('cell');
                //graph.setCellStyles(fillColor,black);
                if(cell11==null){
                    $("#pictureId").css({"display":"none"});
                    return ;
                }else if(cell11.id=='xsqkdj'){
                    window.location.href='/jls_xsqkdj/xsqkdjForm.html';
                }else if (cell11.id=='ldsp'){
                    window.location.href='';
                }else if (cell11.id=='xscx'){
                    window.location.href='/jls_xsqkdj/xscx.html';
                }
            });
            //鼠标悬浮效果
            var track = new mxCellTracker(graph);
            var self = this;
            track.mouseMove = function(sender, me) {
                var cell1 = this.getCell(me);
                if(cell1==null){
                    $("#pictureId").css({"display":"none"});
                    return ;
                }else{
                    if(cell1.id=="tscldj"){
                        $("#pictureId").css({"display":"block","left":"250px","top":"170px"});
                        $("#pictureId").html("投诉处理登记登记！");
                    }else if (cell1.id=="ldsp"){
                        $("#pictureId").css({"display":"block","left":"550px","top":"170px"});
                        $("#pictureId").html("领导审批！");
                    }else if (cell1.id=="cldjcljg"){
                        $("#pictureId").css({"display":"block","left":"850px","top":"170px"});
                        $("#pictureId").html("登记处理结果！");
                    }
                }
            };
            //
            function bodyScale(){
                var main = document.getElementById("main"); //获取id="main"
                var devicewidth=document.documentElement.clientWidth;
                var scale=devicewidth/1275;//除去当前流量器分辨率1275
                main.style.zoom=scale;//zoom是设置或检索对象的缩放比例.
            }
            window.onload=window.onresize=function(){
                bodyScale();
            }


        }





        var initView=function(){
            console.info("进入rsdj的sea.js");
            initHtml();
        }
        initView();

    });
